<?php
include_once "conn.php";
$name = $_POST['name'];
$pw = $_POST['pw'];
$main = new main();
$check = $main->checkname($name);
if ($check){
    $a['error']= 2;//重复
}else{
    $result = $main-> addadminer($name,$pw);
    $result1 = $main->addadminers($result);
    if ($result1==1){
        $a['error']= 1;//成功
    }
    else{
        $a['error']=0;
    }
}
echo json_encode($a);